﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using bus_TienichNPC;
using busDanhMuc;

namespace serBaocaoNPC
{
    /// <summary>
    /// Summary description for Service_TienichNPC
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service_TienichNPC : System.Web.Services.WebService
    {
        cls_TienichNPC_bus bus = new cls_TienichNPC_bus();
        cls_D_DVI_QLY bus_D_DVI_QLY = new cls_D_DVI_QLY();

        cls_NPC_USER_bus bus_NPC_USER = new cls_NPC_USER_bus();
        cls_NPC_LIBRARY bus_NPC_LIBRARY = new cls_NPC_LIBRARY();
        cls_NPC_MENU bus_NPC_MENU = new cls_NPC_MENU();
        cls_NPC_MENUOFUSER bus_NPC_MENUOFUSER = new cls_NPC_MENUOFUSER();

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        #region  Baocao NPC

        [WebMethod]
        public DataSet get_D_DVIQLY(string p_madonvi)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_D_DVIQLY(p_madonvi);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet select_D_DVI_QLY_ALL(string strMadviqly)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_D_DVI_QLY_ALL(strMadviqly);
                return ds;
            }
            catch
            { return null; }
        }

        # region KDDN-09
        [WebMethod]
        public DataSet select_BCKD11(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD11(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }

        [WebMethod]
        public DataSet TH_KDDN09(Int16 p_nam, Int16 p_thang, string p_madonvi)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.TH_KDDN09(p_nam, p_thang, p_madonvi);
                return ds;
            }
            catch
            { return null; }
        }

        # endregion

        #  region KDDN-10
        [WebMethod]
        public void TH_BCTTCC(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.TH_BCTTCC(p_madonvi, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void TH_BCTTTT(string p_madonvi, Int16 p_thang, Int16 p_nam, string p_nhapth, string p_dncd)
        {
            try
            {
                bus.TH_BCTTTT(p_madonvi, p_thang, p_nam, p_nhapth, p_dncd);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void TH_BCTTDD(string p_madonvi, Int16 p_thang, Int16 p_nam, string p_nhapth)
        {
            try
            {
                bus.TH_BCTTDD(p_madonvi, p_thang, p_nam, p_nhapth);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void TH_BCKD07(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.TH_BCKD07(p_madonvi, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public bool Capnhat_BCKD07_saunhap(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                if (bus.Capnhat_BCKD07_saunhap(p_madonvi, p_thang, p_nam))
                {
                    return true;
                }
                else return false;
            }
            catch
            { return false; }
        }
        [WebMethod]
        public DataSet get_bcttcc(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_bcttcc(p_madonvi, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet get_bctt_quy(string p_madonvi, Int16 p_nam, Int16 p_thang, Int16 pbieu, string p_nhapth)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_bctt_quy(p_madonvi, p_nam, p_thang, pbieu, p_nhapth);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet get_bctttt(string p_madonvi, Int16 p_thang, Int16 p_nam, string p_nhapth)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_bctttt(p_madonvi, p_thang, p_nam, p_nhapth);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet get_bcttdd(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_bcttdd(p_madonvi, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet get_bckd07(string p_madonvi, Int16 p_thang, Int16 p_nam)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.get_bckd07(p_madonvi, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void CapnhatdstramCC_KH(string p_madonvi)
        {
            try
            {
                bus.CapnhatdstramCC_KH(p_madonvi);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void CapnhatdsloTT_KH(string p_madonvi)
        {
            try
            {
                bus.CapnhatdsloTT_KH(p_madonvi);
            }
            catch
            { return; }
        }

        [WebMethod]
        public DataSet Load_KHOACHTRAMCC(string p_madonvi)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.Load_KHOACHTRAMCC(p_madonvi);
                return ds;
            }
            catch
            { return null; }
        }

        [WebMethod]
        public DataSet Load_KHOACHLOTT(string p_madonvi)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.Load_KHOACHLOTT(p_madonvi);
                return ds;
            }
            catch
            { return null; }
        }

        [WebMethod]
        public bool update_bckd07(DataSet ds)
        {
            try
            {
                if (bus.update_bckd07(ds))
                {
                    return true;
                }
                else return false;
            }
            catch
            { return false; }
        }
        [WebMethod]
        public bool update_khttcc(DataSet ds)
        {
            try
            {
                if (bus.update_khttcc(ds))
                {
                    return true;
                }
                else return false;
            }
            catch
            { return false; }
        }
        [WebMethod]
        public bool update_khtttt(DataSet ds)
        {
            try
            {
                if (bus.update_khtttt(ds))
                {
                    return true;
                }
                else return false;
            }
            catch
            { return false; }
        }

        #endregion

        # region KDDN-13
        [WebMethod]
        public void PC1_BIEU16_IN(string p_ma_dviqly, Int16 p_thang, Int16 p_nam, string p_stt, string p_maso, string p_danhmuc, Int16 p_sltbc)
        {
            try
            {
                bus.PC1_BIEU16_IN(p_ma_dviqly, p_thang, p_nam, p_stt, p_maso, p_danhmuc, p_sltbc);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU16_UP(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU16_UP(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU16_DEL(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU16_DEL(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_BCKD16(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD16(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        #region KDDN-11
        [WebMethod]
        public DataSet select_PC1_BCKD17(String strMa_dviqly, int p_thang, int p_nam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_PC1_BCKD17(strMa_dviqly, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet KHOITAO_BIEU17(Int16 iNam, Int16 iThang, System.String strMaDviqly)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.KHOITAO_BIEU17(iNam, iThang, strMaDviqly);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet INBIEU(System.String strMaDviqly, Int16 iNam, Int16 iThang, Int16 bieu)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.INBIEU(strMaDviqly, iNam, iThang, bieu);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet Chon_cty_dienluc(Int16 iNam, Int16 iThang, System.String strMaDviqly, Int16 p_bieu)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.Chon_cty_dienluc(iNam, iThang, strMaDviqly, p_bieu);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet UPDATE_BIEU17(Int16 iNam, Int16 iThang, System.String strMaDviqly, System.String ma_so, Int64 TSKH, Int64 SL_BBKT, Int64 SL_VPHC, Int64 KQ_HH_CT, Int64 KQ_HH_TUTI, Int64 KQ_HH_MD, Int64 KQ_HH_HSN, Int64 KQ_HH_SK, Int64 KQ_VP_TCD_CM, Int64 KQ_VP_TCD_XPCT, Int64 KQ_VP_TCD_XPMD, Int64 KQ_VP_TCD_HTK, Int64 KQ_VP_CSGCD, Int64 KQ_VP_GD_SMD, Int64 KQ_VP_GD_AGS, Int64 KQ_VP_VPK)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.UPDATE_BIEU17(iNam, iThang, strMaDviqly, ma_so, TSKH, SL_BBKT, SL_VPHC, KQ_HH_CT, KQ_HH_TUTI, KQ_HH_MD, KQ_HH_HSN, KQ_HH_SK, KQ_VP_TCD_CM, KQ_VP_TCD_XPCT, KQ_VP_TCD_XPMD, KQ_VP_TCD_HTK, KQ_VP_CSGCD, KQ_VP_GD_SMD, KQ_VP_GD_AGS, KQ_VP_VPK);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        #region KDDN-12
        [WebMethod]
        public DataSet select_PC1_BCKD18(String strMa_dviqly, int p_thang, int p_nam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_PC1_BCKD18(strMa_dviqly, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet KHOITAO_BIEU18(Int16 iNam, Int16 iThang, System.String strMaDviqly)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.KHOITAO_BIEU18(iNam, iThang, strMaDviqly);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet UPDATE_BIEU18(Int16 iNam, Int16 iThang, System.String strMaDviqly, System.String ma_so, Int64 TSV_DXLX, Int64 TSV_DXL, Int64 TSV_CSCT, Int64 DN_TRTH, Int64 DN_THHO, Int64 DN_BOTH, Int64 ST_TRTH, Int64 ST_THHO, Int64 ST_BOTH, Int64 ST_PH, Int64 ST_THKH)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.UPDATE_BIEU18(iNam, iThang, strMaDviqly, ma_so, TSV_DXLX, TSV_DXL, TSV_CSCT, DN_TRTH, DN_THHO, DN_BOTH, ST_TRTH, ST_THHO, ST_BOTH, ST_PH, ST_THKH);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        #region KDDN-00 TUNGND
        [WebMethod]
        public DataSet BCKD00_DANHMUC(String strMa_dviqly, Int16 bieu)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.BCKD00_DANHMUC(strMa_dviqly, bieu);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void INSERT_DM(Int16 P_STT, string P_DVT, string P_DM, string P_MASO, string p_madonvi)
        {
            try
            {
                bus.INSERT_DM(P_STT, P_DVT, P_DM, P_MASO, p_madonvi);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void UPDATE_DM(Int16 P_STT, string P_DVT, string P_DM, string P_MASO, string p_madonvi)
        {
            try
            {
                bus.UPDATE_DM(P_STT, P_DVT, P_DM, P_MASO, p_madonvi);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void DELETE_DM(Int16 P_STT, string P_DVT, string P_DM, string P_MASO, string p_madonvi)
        {
            try
            {
                bus.DELETE_DM(P_STT, P_DVT, P_DM, P_MASO, p_madonvi);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void tonghop(Int16 p_nam, Int16 p_thang, string p_madonvi)
        {
            try
            {
                bus.tonghop(p_nam, p_thang, p_madonvi);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet KHOITAO_BIEU00(Int16 iNam, Int16 iThang, System.String strMaDviqly)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.KHOITAO_BIEU00(iNam, iThang, strMaDviqly);
                return ds;
            }
            catch
            { return null; }
        }

        [WebMethod]
        public void UPDATE_BIEU00(Int16 p_nam, Int16 p_thang, string p_madonvi)
        {


            try
            {
                bus.UPDATE00(p_nam, p_thang, p_madonvi);

            }
            catch
            { return; }
        }

        [WebMethod]
        public void DELETE_00(Int16 p_nam, Int16 p_thang, string p_madonvi)
        {
            try
            {
                bus.DELETE_00(p_nam, p_thang, p_madonvi);

            }
            catch
            { return; }
        }
        [WebMethod]
        public void BCKD00(Int16 p_nam, Int16 p_thang, string p_madonvi, Int16 p_STT, string P_DM_NAME, string P_MASO, string P_DONVI_DO, Double P_KH_GIAO, Double P_THANG_TH, string P_PHANTICH_DANHGIA, string P_YKIEN_KHAC)
        {
            try
            {
                bus.BCKD00(p_nam, p_thang, p_madonvi, p_STT, P_DM_NAME, P_MASO, P_DONVI_DO, P_KH_GIAO, P_THANG_TH, P_PHANTICH_DANHGIA, P_YKIEN_KHAC);

            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_PC1_BCKD00(String strMa_dviqly, int p_thang, int p_nam)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_PC1_BCKD00(strMa_dviqly, p_thang, p_nam);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        # region KDDN-4A
        [WebMethod]
        public void PC1_BIEU4A_IN(string p_ma_dviqly, Int16 p_thang, Int16 p_nam, string p_stt, string p_danhmuc, string p_maso, Decimal p_cu1_dk, Decimal p_dt1_dk, Decimal p_cu3_dk, Decimal p_dt3_dk, Decimal p_cu1_m, Decimal p_dt1_m, Decimal p_cu3_m, Decimal p_dt3_m, Decimal p_cu1_t, Decimal p_dt1_t, Decimal p_cu3_t, Decimal p_dt3_t, string p_ghi_chu)
        {
            try
            {
                bus.PC1_BIEU4A_IN(p_ma_dviqly, p_thang, p_nam, p_stt, p_danhmuc, p_maso, p_cu1_dk, p_dt1_dk, p_cu3_dk, p_dt3_dk, p_cu1_m, p_dt1_m, p_cu3_m, p_dt3_m, p_cu1_t, p_dt1_t, p_cu3_t, p_dt3_t, p_ghi_chu);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU4A_UP(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU4A_UP(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU4A_DEL(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU4A_DEL(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_BCKD4A(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD4A(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet select_BCKD4A_Full_CTY(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD4A_Full_CTY(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        # region KDDN-4B
        [WebMethod]
        public void PC1_BIEU4B_IN(string p_ma_dviqly, Int16 p_thang, Int16 p_nam, string p_stt, string p_danhmuc, string p_maso, Decimal p_BDA_DK, Decimal p_KHG1_DK, Decimal p_TL1_DK, Decimal p_TONG_DK, Decimal p_CT_DK, Decimal p_HT_DK, Decimal p_KHG2_DK, Decimal p_TL2_DK, Decimal p_BDA_M, Decimal p_CT_M, Decimal p_HT_M, Decimal p_BDA_T, Decimal p_CT_T, Decimal p_HT_T, string p_ghi_chu)
        {
            try
            {
                bus.PC1_BIEU4B_IN(p_ma_dviqly, p_thang, p_nam, p_stt, p_danhmuc, p_maso, p_BDA_DK, p_KHG1_DK, p_TL1_DK, p_TONG_DK, p_CT_DK, p_HT_DK, p_KHG2_DK, p_TL2_DK, p_BDA_M, p_CT_M, p_HT_M, p_BDA_T, p_CT_T, p_HT_T, p_ghi_chu);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU4B_UP(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU4B_UP(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU4B_DEL(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU4B_DEL(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_BCKD4B(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD4B(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public DataSet select_BCKD4B_Full_CTY(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD4B_Full_CTY(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }
        #endregion

        # region KDDN-5A
        [WebMethod]
        public void PC1_BIEU5A_IN(string p_ma_dviqly, Int16 p_thang, Int16 p_nam, string p_stt, string p_danhmuc, string p_maso, Decimal p_DAU_KY, Decimal p_TANG, Decimal p_GIAM, Decimal p_LUY_KE)
        {
            try
            {
                bus.PC1_BIEU5A_IN(p_ma_dviqly, p_thang, p_nam, p_stt, p_danhmuc, p_maso, p_DAU_KY, p_TANG, p_GIAM, p_LUY_KE);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU5A_UP(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU5A_UP(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU5A_DEL(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU5A_DEL(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_BCKD5A(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD5A(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }

        #endregion

        # region KDDN-5B
        [WebMethod]
        public void PC1_BIEU5B_IN(string p_ma_dviqly, Int16 p_thang, Int16 p_nam, string p_stt, string p_danhmuc, string p_maso, Decimal p_PHAT_SINH, Decimal p_LUY_KE, String p_GHI_CHU)
        {
            try
            {
                bus.PC1_BIEU5B_IN(p_ma_dviqly, p_thang, p_nam, p_stt, p_danhmuc, p_maso, p_PHAT_SINH, p_LUY_KE, p_GHI_CHU);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU5B_UP(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU5B_UP(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void PC1_BIEU5B_DEL(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.PC1_BIEU5B_DEL(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public DataSet select_BCKD5B(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intNam, System.Int16 intThang)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_BCKD5B(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intNam, intThang);
                return ds;
            }
            catch
            { return null; }
        }

        #endregion

        #region KDDN - BIA BAOCAO

        [WebMethod]
        public DataSet select_PC1_BIABC(string strMadviqly)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_PC1_BIABC(strMadviqly);
                return ds;
            }
            catch
            { return null; }
        }

        [WebMethod]
        public bool insert_PC1_BIABC(string strMadviqly, string strNoidung, string strSobcao)
        {
            bool check = false;
            try
            {
                return check = bus.insert_PC1_BIABC(strMadviqly, strNoidung, strSobcao);
            }
            catch
            { return false; }
        }

        [WebMethod]
        public bool update_PC1_BIABC(string strMadviqly, string strNoidung, string strSobcao)
        {
            bool check = false;
            try
            {
                return check = bus.update_PC1_BIABC(strMadviqly, strNoidung, strSobcao);
            }
            catch
            { return false; }
        }

        #endregion

        #region  Bieu 01 - NGC
        [WebMethod]
        public DataSet select_NGCBIEU01(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intThang, System.Int16 intNam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_NGCBIEU01(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intThang, intNam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void NGE_BIEU01(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.NGE_BIEU01(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void NGE_UPDATE01(Decimal p_dientp, Decimal p_tiendien, Decimal p_tiencspk, Decimal p_tiendienthue, Decimal p_tiencspkthue, Int16 p_nam, Int16 p_thang, String p_ma_dviqly, String p_ma_dviqly1)
        {
            try
            {
                bus.NGE_UPDATE01(p_dientp, p_tiendien, p_tiencspk, p_tiendienthue, p_tiencspkthue, p_nam, p_thang, p_ma_dviqly, p_ma_dviqly1);
            }
            catch
            { return; }
        }
        #endregion

        #region  Bieu 02 - NGC
        [WebMethod]
        public DataSet select_NGCBIEU02(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intThang, System.Int16 intNam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_NGCBIEU02(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intThang, intNam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void NGE_BIEU02(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.NGE_BIEU02(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void NGE_UPDATE02(Decimal p_congto, Decimal p_hdcnxd, Decimal p_hdqltd, Decimal p_doituong, Decimal p_daky, Decimal p_phaimuacos, Decimal p_nam, Decimal p_thang, String p_ma_dviqly)
        {
            try
            {
                bus.NGE_UPDATE02(p_congto, p_hdcnxd, p_hdqltd, p_doituong, p_daky, p_phaimuacos, p_nam, p_thang, p_ma_dviqly);
            }
            catch
            { return; }
        }
        #endregion

        #region  Bieu 03 - NGC
        [WebMethod]
        public DataSet select_NGCBIEU03(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intThang, System.Int16 intNam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_NGCBIEU03(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intThang, intNam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void NGE_BIEU03(string p_ma_dviqly, Int16 p_thang, Int16 p_nam)
        {
            try
            {
                bus.NGE_BIEU03(p_ma_dviqly, p_thang, p_nam);
            }
            catch
            { return; }
        }
        #endregion

        #region  Bieu 04 - NGC
        [WebMethod]
        public DataSet select_NGCBIEU04(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intThang, System.Int16 intNam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_NGCBIEU04(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intThang, intNam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void NGE_BIEU04(Int16 p_nam, Int16 p_thang, string p_ma_dviqly)
        {
            try
            {
                bus.NGE_BIEU04(p_nam, p_thang, p_ma_dviqly);
            }
            catch
            { return; }
        }
        #endregion

        #region  Bieu 05 - NGC
        [WebMethod]
        public DataSet select_NGCBIEU05(System.String strTEN_DVIQLY, System.String strTEN_CTREN, System.String pr_MA_DVIQLY, System.Int16 intThang, System.Int16 intNam)
        {

            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_NGCBIEU05(strTEN_DVIQLY, strTEN_CTREN, pr_MA_DVIQLY, intThang, intNam);
                return ds;
            }
            catch
            { return null; }
        }
        [WebMethod]
        public void NGE_BIEU05(Int16 p_nam, Int16 p_thang, string p_ma_dviqly)
        {
            try
            {
                bus.NGE_BIEU05(p_nam, p_thang, p_ma_dviqly);
            }
            catch
            { return; }
        }
        [WebMethod]
        public void NGE_UPDATE05(Decimal dunodt, Decimal thutthang, String p_madm, Decimal p_nam, Decimal p_thang, String p_ma_dviqly)
        {
            try
            {
                bus.NGE_UPDATE05(dunodt, thutthang, p_madm, p_nam, p_thang, p_ma_dviqly);
            }
            catch
            { return; }
        }
        #endregion







        #endregion

        # region InToGCS
        [WebMethod]
        public DataSet TH_INTOGCS(Int16 iNam, Int16 iThang, Int16 iKy, string strMaDviqly, string strMa_SoGCS, string strMa_KHang)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.TH_INTOGCS(iNam, iThang, iKy, strMaDviqly, strMa_SoGCS, strMa_KHang);
                return ds;
            }
            catch
            {
                return null;
            }
        }

        [WebMethod]
        public DataSet select_SoGCS(System.String pr_MA_DVIQLY, System.String pr_MA_SOGCS, System.String pr_TEN_SOGCS, System.String pr_NGAY_GHI, System.Int16 pr_SO_KY)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = bus.select_SoGCS(pr_MA_DVIQLY, pr_MA_SOGCS, pr_TEN_SOGCS, pr_NGAY_GHI, Convert.ToInt16(pr_SO_KY));
                return ds;
            }
            catch
            {
                return null;
            }
        }
        #endregion


        #region QUANTRI
        [WebMethod]
        public DataSet select_D_DVI_QLY_captren(string strMadviqly)
        {
            DataSet ds = new DataSet();
            ds = bus_D_DVI_QLY.select_D_DVI_QLY_captren(strMadviqly);
            return ds;
        }

        [WebMethod]
        public DataSet get_SQUAN_TRI(string strmadvi, ref  string strErr)
        {
            DataSet ds = bus_D_DVI_QLY.get_SQUAN_TRI(strmadvi, ref strErr);
            return ds;
        }

        [WebMethod]
        public DataSet GET_DVIQLY_QUANTRI()
        {
            DataSet ds = bus_NPC_USER.GET_DVIQLY_QUANTRI();
            return ds;
        }
        [WebMethod]
        public DataSet GET_USER_QUANTRI(string USER_NAME, string PASS, string SMA_DVIQLY, ref string maloi)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_USER.GET_USER_QUANTRI(USER_NAME, PASS, SMA_DVIQLY, ref maloi);
            return ds;
        }
        [WebMethod]
        public DataSet GET_USERNAME(string SMA_DVIQLY, ref string maloi)
        {
            DataSet ds = bus_NPC_USER.GET_USERNAME(SMA_DVIQLY, ref maloi);
            return ds;
        }
        [WebMethod]
        public DataSet GET_USERNAME_NGUOIDUNG(string SMA_DVIQLY, string User, ref string maloi)
        {
            DataSet ds = bus_NPC_USER.GET_USERNAME_NGUOIDUNG(SMA_DVIQLY, User, ref maloi);
            return ds;
        }
        [WebMethod]
        public bool Check_USERNAME(string USER_NAME, string SMA_DVIQLY)
        {
            bool check = bus_NPC_USER.Check_USERNAME(USER_NAME, SMA_DVIQLY);
            return check;
        }

        [WebMethod]
        public bool insert_USERNAME(DataSet Entity, ref string maloi)
        {
            bool check = bus_NPC_USER.insert_USERNAME(Entity, ref maloi);
            return check;
        }

        [WebMethod]
        public bool delete_USERNAME(string s_dviqly, string username, ref string maloi)
        {
            bool check = bus_NPC_USER.delete_USERNAME(s_dviqly, username, ref maloi);
            return check;
        }

        [WebMethod]
        public bool update_USERNAME(string s_dviqly, string username, string fullname, string pass, string email, string phone, short trangthai, ref string maloi)
        {
            bool check = bus_NPC_USER.update_USERNAME(s_dviqly, username, fullname, pass, email, phone, trangthai, ref maloi);
            return check;
        }
        #endregion


        #region services NPC_LIBRARY
        [WebMethod]
        public DataSet select_NPC_LIBRARY_by_LIBID(long longLIBID)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_LIBRARY.select_NPC_LIBRARY_by_LIBID(longLIBID);
            return ds;
        }

        [WebMethod]
        public DataSet select_NPC_LIBRARY_1by1(DataSet Entity)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_LIBRARY.select_NPC_LIBRARY_1by1(Entity);
            return ds;
        }

        [WebMethod]
        public bool insert_NPC_LIBRARY(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_LIBRARY.insert_NPC_LIBRARY(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public bool update_NPC_LIBRARY(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_LIBRARY.update_NPC_LIBRARY(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public bool delete_NPC_LIBRARY(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_LIBRARY.delete_NPC_LIBRARY(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public long GetNextSequence_Library(ref string strErr)
        {
            long NextSequence = -1;
            NextSequence = bus_NPC_LIBRARY.GetNextSequence(ref strErr);
            return NextSequence;
        }

        #endregion

        #region services NPC_MENU

        [WebMethod]
        public DataSet select_NPC_MENU_All()
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_MENU.select_NPC_MENU_All();
            return ds;
        }

        [WebMethod]
        public DataSet select_NPC_MENU_by_ID(long longMENUID)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_MENU.select_NPC_MENU_by_ID(longMENUID);
            return ds;
        }

        [WebMethod]
        public DataSet select_NPC_MENU_by_PARENTID(long longMENUID)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_MENU.select_NPC_MENU_by_PARENTID(longMENUID);
            return ds;
        }

        //[WebMethod]
        //public DataSet select_NPC_MENU_by_LIBID(long longLIBID)
        //{
        //    DataSet ds = new DataSet();
        //    ds = bus_NPC_MENU.select_NPC_MENU_by_LIBID(longLIBID);
        //    return ds;
        //}

        [WebMethod]
        public bool insert_NPC_MENU(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_MENU.insert_NPC_MENU(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public bool update_NPC_MENU(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_MENU.update_NPC_MENU(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public bool delete_NPC_MENU(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_MENU.delete_NPC_MENU(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public long GetNextSequence_menu(ref string strErr)
        {
            long NextSequence = -1;
            NextSequence = bus_NPC_MENU.GetNextSequence(ref strErr);
            return NextSequence;
        }

        #endregion

        #region services NPC_MENUOFUSER

        [WebMethod]
        public DataSet select_NPC_MENUOFUSER_by_USERID(string strSUBDIVISIONID, long longUSERID)
        {
            DataSet ds = new DataSet();
            ds = bus_NPC_MENUOFUSER.select_NPC_MENUOFUSER_by_USERID(strSUBDIVISIONID, longUSERID);
            return ds;
        }

        [WebMethod]
        public bool insert_NPC_MENUOFUSER(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_MENUOFUSER.insert_NPC_MENUOFUSER(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public bool delete_NPC_MENUOFUSER(DataSet Entity, ref string strErr)
        {
            bool check;
            check = bus_NPC_MENUOFUSER.delete_NPC_MENUOFUSER(Entity, ref strErr);
            return check;
        }

        [WebMethod]
        public long GetNextSequence_menuofuser(ref string strErr)
        {
            long NextSequence = -1;
            NextSequence = bus_NPC_MENUOFUSER.GetNextSequence(ref strErr);
            return NextSequence;
        }

        #endregion

        #region TOGCS TUNGVT

        [WebMethod]
        public DataSet togcs(Int16 i16NamHD, Int16 i16ThangHD, Int16 i16Ky, string strMa_dviqly, string strMa_sogcs, string strMa_khang)
        {
            DataSet ds = new DataSet();
            ds = bus.Togcs(i16NamHD, i16ThangHD, i16Ky, strMa_dviqly, strMa_sogcs, strMa_khang);
            return ds;
        }

        [WebMethod]
        public string hell()
        {
            return bus.hell();
        }

        #endregion
    }
}
